home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / DTS QT Utilities.Aug-95 / Projects & Test Apps / DigitizerShell / Mac Framework / MacFramework.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-10  |  3.5 KB  |  137 lines  |  [TEXT/MPCC]

  1. /*
  2.     File:        MacFramework.h
  3.  
  4.     Contains:    Basic Macintosh Functions for window, menu handling and similar things for the 
  5.                     SG/vdig environment.
  6.  
  7.     Written by:    DTS
  8.  
  9.     Copyright:    © 1994-1995 by Apple Computer, Inc., all rights reserved.
  10.  
  11.     Change History (most recent first):
  12.  
  13.        <1>             4/25/95    khs        first file
  14.        
  15. */
  16.  
  17.  
  18. #pragma once
  19.  
  20.  
  21. // INCLUDES
  22. #include <Movies.h>
  23. #include <QuickTimeComponents.h>
  24. #include <TextUtils.h>
  25. #include <Memory.h>
  26.  
  27. #include <stdio.h>
  28.  
  29. #ifdef __MWERKS__
  30. #include <sioux.h>
  31. #endif // __MWERKS__
  32.  
  33.  
  34. // ENUMS, DEFINES AND GLOBALS
  35. enum         {  kMovieControllerObject  = 'MCOb'
  36.              };
  37.  
  38.  
  39.  
  40. // ENUMS 
  41. // MENUS
  42. enum eMenubar { mMenubar = 128};
  43.  
  44. enum eMainMenus {
  45.     mApple = 128, mFile, mEdit
  46. };
  47.  
  48. enum  eAppleMenu {
  49.     iAbout = 1
  50. };
  51.  
  52. enum   eFileMenu{
  53.     iNew = 1, iClose, iQuit = 4
  54. };
  55.  
  56. enum eEditMenu {
  57.     iUndo = 1, iCut = 3, iCopy, iPaste, iClear, iSelectAll = 8
  58. };
  59.  
  60. // DIALOGS
  61. enum eDialogs {
  62.     kAboutBox = 128, kAlertError = 129
  63. };
  64.  
  65.  
  66. // TYPEDEFS AND STRUCTURES
  67. // WindowObjectRecord/Ptr is a data structure attached to the movie window. Use
  68. // this structure if you want to associate any data with any window presented.
  69.  
  70. typedef struct {
  71.     OSType                    ObjectType;                        // specific tag indicating that the window object belongs to our application
  72.     MovieController     controller;
  73.     Rect                        originalSize;                    // including movie controller
  74.     FSSpec                    FileFSSpec;
  75.     short                    FileResID;
  76.     short                    FileRefNum;
  77.     
  78. // add more elements if needed
  79. } WindowObjectRecord, *WindowObjectPtr, **WindowObject;
  80.  
  81. // SG specific data structures
  82.  
  83. typedef struct {
  84.     SeqGrabComponent     sg;
  85.     SGChannel                    videoChannel;
  86.     SGChannel                    soundChannel;
  87.     WindowPtr                sgWindow;
  88. } SGResourceRecord, *SGResourcePtr, **SGResourceHndl;
  89.  
  90.  
  91. // FUNCTION PROTOTYPES
  92.  
  93. // PURE MAC TOOLBOX FUNCTIONS
  94. void                            InitStack(long extraStackSpace);
  95. void                             InitMacEnvironment(long nMoreMasters);
  96.  
  97. Boolean                     InitMenubar(void);
  98. void                             HandleMenuCommand(long theMenuResult);
  99. void                             AdjustMenus(void);
  100. void                             MainEventLoop(void);
  101.  
  102. Boolean                     IsAppWindow(WindowRef theWindow);
  103. WindowObject             CreateWindowObject(WindowRef theWindow);
  104.  
  105. void                             HandleKeyPress(EventRecord *theEvent);
  106. void                             ShowAboutDialogBox(void);
  107. void                             ShowWarning(Str255 theMessage, OSErr theErr);
  108.  
  109. void                             DoDestroyMovieWindow(WindowRef theWindow);
  110. void                             DoActivateWindow(WindowRef theWindow, Boolean becomingActive);
  111.  
  112.  
  113. // APPLICATION SPECIFIC FUNCTIONS
  114. // These are placed in the MacApplication.c file, you could override these for changing
  115. // the behavior of the function in a specific application.
  116.  
  117. void                            DoIdle(WindowRef theWindow);
  118. void                            DoUpdateWindow(WindowRef theWindow, Rect *theRefrehArea);
  119. void                             DoCloseWindow(WindowRef theWindow);
  120. void                            DoDragWindow(WindowRef theWindow, EventRecord *theEvent);
  121. void                             HandleContentClick(WindowRef theWindow, EventRecord *theEvent);
  122. WindowRef                 CreateMovieWindow(Rect *theRect, Str255 theTitle);
  123. void                             HandleApplicationMenu(short theMenuID, short theMenuItem);
  124. void                            AdjustApplicationMenus(void);
  125.  
  126. // These are very specific sequence grabber and vdig functions used from the actual
  127. // application level.
  128. void                            CreateSGEnviroment(void);
  129. SeqGrabComponent    GetDefaultSGInstance(void);
  130. SGChannel                    GetDefaultVideoChannel(void);
  131. SGChannel                    GetDefaultAudioChannel(void);
  132.  
  133. pascal ComponentResult SpecialGrabFrameComplete(SGChannel c, short bufferNum,
  134.                                                                                 Boolean *done, long refCon);
  135. OSErr SetupVideoBottleNecks(SGChannel videoChannel, WindowPtr theWindow, CGrafPtr tempPort);
  136.  
  137.